﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RegisterModel>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="JSContent" runat="server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%: Html.Partial("Sidebar") %>
    <div id="main">
        <div class="main-block">
            <h2 class="title">
                <%:"Create Account".Localize() %></h2>
            <div class="main-block-content clearfix">
                <p>
                    <%:"If you already have an account with us, please login at the".Localize() %> <a href="/Logon">
                        <%:"login page".Localize() %></a>.</p>
                <div class="common-form">
                    <%using (Html.BeginForm())
                      {
                          Html.EnableClientValidation();
                    %>
                    <strong>Your Personal Details</strong>
                    <fieldset>
                        <p>
                            <label for="UserName">
                                <span>*</span> User Name</label>
                            <%: Html.TextBoxFor(i => i.UserName)%>
                            <%: Html.ValidationMessageFor(i=>i.UserName) %>
                        </p>
                        <p>
                            <label for="Email">
                                <span>*</span> E-Mail</label>
                            <%: Html.TextBoxFor(i=>i.Email) %>
                            <%: Html.ValidationMessageFor(i=>i.Email) %>
                        </p>
                        <p>
                            <label for="password">
                                <span>*</span> Password</label>
                            <%: Html.PasswordFor(i => i.Password)%>
                            <%: Html.ValidationMessageFor(i => i.Password)%>
                        </p>
                        <p>
                            <label for="passwordCheck">
                                <span>*</span> Password Confirm</label>
                            <%: Html.PasswordFor(i => i.ConfirmPassword)%>
                            <%: Html.ValidationMessageFor(i => i.ConfirmPassword)%>
                        </p>
                    </fieldset>
                    <fieldset class="buttons">
                        <label class="checkbox-label" for="agree">
                            <%:"I have read and agreed to the".Localize() %> <a href="#">
                                <%:"Privacy Policy".Localize() %></a></label>
                        <input type="checkbox" id="agree" name="agree" />
                        <button class="button" type="submit">
                            <em><span>
                                <%:"Continue".Localize() %></span></em></button>
                    </fieldset>
                    <%} %>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $("form").submit(function () {
            if (!$("#agree").attr("checked")) {
                alert("<%:"You need to agree to the 'Privacy Policy' before you register.".Localize() %>");
                return false;
            }
        });
    
    </script>
    <% 
        var exception = ViewData.ModelState["Exception"];
        if (exception != null)
        {
            var error = "";
            foreach (var i in ViewData.ModelState["Exception"].Errors)
            {
                error += i.ErrorMessage;
            }

            if (string.IsNullOrWhiteSpace(error) == false)
            {
    %>
    <script type="text/javascript">        
        alert('<%= error.Replace("'","''") %>')
    </script>
    <%
            }
        }
    %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Breadcrumb" runat="server">
    <ul class="breadcrumb">
        <li><a href="/Home/Index">
            <%:"Home".Localize() %></a>&gt;</li>
        <li>
            <%:"Register".Localize() %></li>
    </ul>
</asp:Content>
